package cn.stylefeng.guns.modular.fileAssociation.mapper;

import cn.stylefeng.guns.modular.file.entity.File;
import cn.stylefeng.guns.modular.fileAssociation.entity.FileAssociation;
import cn.stylefeng.guns.modular.fileAssociation.model.params.FileAssociationParam;
import cn.stylefeng.guns.modular.fileAssociation.model.result.FileAssociationResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 文件关联 Mapper 接口
 * </p>
 *
 * @author jalor
 * @since 2019-10-21
 */
public interface FileAssociationMapper extends BaseMapper<FileAssociation> {

    /**
     * 获取列表
     *
     * @author jalor
     * @Date 2019-10-21
     */
    List<FileAssociationResult> customList(@Param("paramCondition") FileAssociationParam paramCondition);

    /**
     * 获取map列表
     *
     * @author jalor
     * @Date 2019-10-21
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") FileAssociationParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author jalor
     * @Date 2019-10-21
     */
    Page<FileAssociationResult> customPageList(@Param("page") Page page,
                                               @Param("paramCondition") FileAssociationParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author jalor
     * @Date 2019-10-21
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page,
                                                @Param("paramCondition") FileAssociationParam paramCondition);

    /**
     * 根据源ID[产品/功能/需求/里程碑]获取文件集合
     *
     * @param type     类型
     * @param sourceId 源ID
     * @return 文件集合
     */
    List<File> listFile(@Param("type") Integer type, @Param("sourceId") Long sourceId);
}
